<template>
  <a-dropdown>
    <a-menu slot="overlay">
      <a-menu-item :key="i" v-for="(o,i) in opts" @click="handleClick(o)"> {{ o.label }} </a-menu-item>
    </a-menu>
    <a-button :type="type" :size="size">
      <slot>Button</slot>
    </a-button>
  </a-dropdown>
</template>

<script>
export default {
  props: {
    type: {
      type: String,
      default: 'primary'
    },
    size: {
      type: String,
      default: 'default'
    },
    opts: {
      type: Array,
      default: () => {
        return [
          { label: '按钮1', disabled: false, divided: false },
          { label: '按钮1', disabled: true, divided: true }
        ]
      }
    }
  },
  methods: {
    handleClick (t) {
      this.$emit('click', t)
    }
  }
}
</script>
<style lang="scss" scoped>
</style>
